package com.yy.device.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 电磁阀-输入-类型枚举
 *
 * @author sunzhiqiang
 * @date 2022/6/21 15:18:50
 */
public enum SolenoidInTypeEnum {
    /*清水池液位状态信号*/
    LIQUID_LEVEL((short) 8),
    /*气泵电流信号*/
    AIR_PUMPS((short) 11),
    /*电磁阀电流信号*/
    SOLENOID((short) 10),
    /*清水池排水泵电流信号*/
    POOL_CLEANING((short) 9),

    ;

    @Getter
    private final short type;

    SolenoidInTypeEnum(short type) {
        this.type = type;
    }

    public static SolenoidInTypeEnum getEnumByType(short type) {
        return Arrays.stream(SolenoidInTypeEnum.values())
                .filter(item -> item.getType() == type)
                .findFirst()
                .orElse(null);
    }
}
